<?php

define('IN_NETGORESP', true);

 /*
   ----------------------------------------------------------------------------------------------------
   INCLUSIONS
   ----------------------------------------------------------------------------------------------------
	+ Common.php
		- Includes all the other files needed.
   ----------------------------------------------------------------------------------------------------
   */
 include("common.php");

 /*
   ----------------------------------------------------------------------------------------------------
   VIEW USER PROFILE
   ----------------------------------------------------------------------------------------------------
	+ Check For ID
		+ Id Check Verified
			+ Check ID Against Database
				+ Check Verified
					- Show User Profile
				+ Check Failed
					- Send User Error
		+ Id Check Failed
			- Send Error
   ----------------------------------------------------------------------------------------------------
   */
 if(isset($_GET['user']))
 {
	$id = $_GET['user'];
	$userquery = getUserByID($db, $id);
	if ($db->sql_rows($userquery) == 1) 
		$userrow = $db->sql_array($userquery); 
	else 
	{ 
		// @template: Header
	 	include("template/".$config['template_name']."/header.php");
		
		// @template: View Profile Error
		include("template/".$config['template_name']."/view.profile.error.php");
		
		// @template: Footer
		include("template/".$config['template_name']."/footer.php");
		
		die();
    }
	
	// User data here
  //$userrow["stat_exp"] = number_format($userrow["stat_exp"]);

	// @template: Header
 	include("template/".$config['template_name']."/header.php");
	
	// @template: View Profile
	include("template/".$config['template_name']."/view.profile.php");
	
	// @template: Footer
	include("template/".$config['template_name']."/footer.php");

	echo $show;
 }
 
?>